package siedler.communication;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.HashMap;
import java.util.Vector;

public interface PeerI extends Remote{
	
	public int getId()throws RemoteException;
	
	public void setId(int id) throws RemoteException;
	
	public void waitForPlayers() throws RemoteException;
	
	public void startGame(Game game) throws RemoteException, InterruptedException;
	
	public double[] helpMeThrowTheDice(PeerI caller, byte[] callerHash1, byte[] callerHash2) throws RemoteException;
	
	public int[] throwTheDice(int range) throws RemoteException;
	
	public void buildBoard() throws RemoteException;
	
	public void setField(int resource, int value) throws RemoteException;
	
	public void boardFinished() throws RemoteException;
	
	public boolean receiveToken() throws RemoteException;
	
	public boolean setTokenHolder(PeerI th) throws RemoteException;
	
	public void startMove() throws RemoteException;
	
	public void endMove() throws RemoteException;
	
	public void receiveMove(Move move) throws RemoteException;
	
	//public boolean verifyDiceResult(PeerI caller, int[] callerDiceResult, double[][] params, double[] callerHashSeeds) throws RemoteException;

	//public void diceResultApproved(PeerI caller, int[] diceResult) throws RemoteException;
	
	public void diceResultReady(PeerI caller, int[] callerDiceResult, double[][] params, double[] callerHashSeeds) throws RemoteException;
	
	public void registerServices(ServicesI services) throws RemoteException;
	
	public void cheaterDetected(PeerI cheater) throws RemoteException;
	
	//public boolean areYouStillHere() throws RemoteException;

	public boolean areYouHere() throws RemoteException;
	
	public void startReceiveThread() throws RemoteException;
	
	public void setPlayers(Vector<PeerI> p) throws RemoteException;
	
	public void setIdAddressMap(HashMap<Integer,String> hm) throws RemoteException;
	
	public boolean haveYouFoundTokenHolder() throws RemoteException;
	
	public boolean haveYouStartedTheGUI() throws RemoteException;
	
	public void setPlayerOffline(int playerID) throws RemoteException;
	
}
